#include <stdio.h>
#define IN	1
#define OUT	0
/*
 * count lines, words, and characters in input
 * My "version"
 */

static int nchar, nword, nwhite;
int iswhite(int);

main(){
	nchar = nword = nwhite = 0;
	int car, inword;
	
	inword = OUT;
	
	while((car = getchar()) != EOF){
		nchar++;
		if(!iswhite(car)){
			if(!inword){
				inword = IN;
				nword++;
			}
		}else{
			inword = OUT;
		}
	}
	
	printf("\nWords: %d\tWhites: %d\tChars: %d\n", nword, nwhite, nchar);
}

int iswhite(int car){
	int result = ((car == '\t') || (car == '\n') || (car == ' '));
	return result ? ++nwhite : result;
}
